package com.zc.mall;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author 曾川
 * @version 1.0.0
 * @ClassName InterceptorConfig.java
 * @Description 拦截器实现类
 * @createTime 2021年06月05日 11:40:00
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new UserLoginInterceptor())
                .addPathPatterns("/**")//默认所有拦截
                .excludePathPatterns("/error","/user/login","/user/register","/categories","/products","/product/*");//不拦截的路径

    }





}
